package com.example.bishe;

import org.springframework.boot.test.context.SpringBootTest;

/**
 * 功能描述
 *
 * @author: LDH
 * @date: 2023年05月12日 14:38
 */
@SpringBootTest
public class jiami2 {

    public static void main(String[] args) {
        String a = "仔细看美女擦拭爱丽丝可能是雄安看性能";
        String b = "oB4nYjnoHhuWrPVi2pYLuPjnCaU0";
        char c = b.charAt(0);
        for (int i = 0; i < b.length(); i++) {
            c ^= b.charAt(i);
        }
        System.out.println("c:"+c);
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < a.length(); i++) {
            stringBuilder.append((char) (c^a.charAt(i)));
        }
        System.out.println("密文："+stringBuilder);
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < stringBuilder.length(); i++) {
            builder.append((char) (c^ stringBuilder.charAt(i)));
        }
        System.out.println("解密："+builder);

        System.out.println("原文对比："+a);
    }

}